﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.Web.UI.WebControls;

namespace brockredge.CLASSES
{
    public class ProSQLDao
    {
        public static SqlConnection GetConnection()
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = ConfigurationManager.ConnectionStrings["PropertyConnectionString"].ToString();
            return conn;
        }

        public static SqlDataReader SelectData(string qyeryString)
        {                                             
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = qyeryString;
            SqlConnection con=ProSQLDao.GetConnection();
            cmd.Connection = con;
            con.Open();           
            SqlDataReader sdr=cmd.ExecuteReader();

            return sdr;
        }

        public static SqlCommand CommandExecutionQuery(string qyeryString,SqlConnection con)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = qyeryString;
            cmd.Connection = con;
               
            return cmd;
        }
    }
}